package com.thinkgem.dingdan.modules.bu.enumerate;

public enum ResultEnum {

	SUCCESS("成功",1),FAIL("失败",0);
	
	private Integer code;
	private String msg;
	
	private ResultEnum(String msg,Integer code){
		this.msg = msg;
		this.code = code;
	}
	
	public static String getName(int code){
		for(ResultEnum en: ResultEnum.values()){
			if(en.getCode() == code){
				return en.name();
			}
		}
		return null;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
}
